const marked = require('marked');
const loaderUtils = require("loader-utils");

module.exports = function (markdown) {
    // this是构建运行时的一些上下文
    const options = loaderUtils.getOptions(this);
    console.log('-----------------');
    console.log('-----------------');
    console.log('-----------------');
    console.log(options);
    console.log('-----------------');
    console.log('-----------------');
    console.log('-----------------');
    this.cacheable();
    marked.setOptions(options);

    return `export default \`${marked(markdown)}\` `
}